package http

import (
	"beergo/lib/base/controller"
)

type ErrorController struct {
	controller.ContainerController
}

func (c *ErrorController) Error404() {
	c.Data["content"] = "page not found"
	c.TplName = "404.tpl"
}

func (c *ErrorController) Error500() {
	c.Data["content"] = "server error"
	c.JsonOut(1, "error", recover())
	c.StopRun()
}

func (c *ErrorController) ErrorDb() {
	c.Data["content"] = "database is now down"
	c.TplName = "dberror.tpl"
}
